﻿using System;
using System.Collections.Generic;
using YJKCopyModel.InteractiveOperation;

namespace YJKCopyModel.RoomTransModel
{
	[Grouper(GrouperName = "RoomGrouper")]
	public class RoomGrouper : IDataGrouper
	{
		public List<RevitModelRequest> GroupData(InputRequest inputRequest)
		{
			List<RevitModelRequest> list = new List<RevitModelRequest>();
			try
			{
				RoomRequest roomRequest = inputRequest as RoomRequest;
				foreach (KeyValuePair<RoomConfigInfo, List<TextInfo>> keyValuePair in roomRequest.ConfigAndTexts)
				{
					foreach (TextInfo text in keyValuePair.Value)
					{
						list.Add(new RoomRevitRequest
						{
							ConfigInfo = keyValuePair.Key,
							Text = text,
							UseExternalCommandData = roomRequest.UseExternalCommandData
						});
					}
				}
			}
			catch (Exception)
			{
			}
			return list;
		}
	}
}
